<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>404 - 页面未找到 - 小舟工具箱</title>
    <link rel="shortcut icon" href="../favicon.png" type="image/png">
    <style>
        :root {
            --bg-color: #ffffff;
            --text-color: #333333;
            --card-bg: #f5f5f5;
            --card-hover: #e0e0e0;
            --modal-bg: rgba(255, 255, 255, 0.95);
            --shadow-color: rgba(0, 0, 0, 0.1);
        }

        [data-theme="dark"] {
            --bg-color: #1a1a1a;
            --text-color: #ffffff;
            --card-bg: #2d2d2d;
            --card-hover: #3d3d3d;
            --modal-bg: rgba(45, 45, 45, 0.95);
            --shadow-color: rgba(0, 0, 0, 0.3);
        }
        

        .demo-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }

        .device-btn {
            padding: 5px 10px;
            border: none;
            border-radius: 4px;
            background: var(--card-bg);
            color: var(--text-color);
            cursor: pointer;
            transition: all 0.3s;
        }

        .device-btn:hover {
            background: var(--card-hover);
        }

        .device-btn.active {
            background: var(--text-color);
            color: var(--bg-color);
        }

        .demo-frame {
            border: 2px solid var(--text-color);
            border-radius: 8px;
            overflow: hidden;
            transition: all 0.3s ease;
            transform-origin: bottom right;
            background: var(--bg-color);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s, color 0.3s;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            line-height: 1.6;
        }

        .error-code {
            font-size: 8rem;
            font-weight: bold;
            margin-bottom: 1rem;
            opacity: 0.8;
        }

        .error-message {
            font-size: 1.5rem;
            margin-bottom: 2rem;
        }

        .countdown {
            font-size: 1.1rem;
            margin-bottom: 1rem;
        }

        .home-link {
            color: var(--text-color);
            text-decoration: none;
            border-bottom: 1px solid var(--text-color);
            padding-bottom: 2px;
        }

        .home-link:hover {
            opacity: 0.8;
        }
    </style>
</head>
<body>
    <div class="error-code">404</div>
    <div class="error-message">抱歉，页面未找到</div>
    <div class="countdown">将在 <span id="timer">3</span> 秒后返回首页</div>
    <a href="/" class="home-link">立即返回首页</a>
    

    <script>
        window.addEventListener('resize', () => {
            const activeBtn = document.querySelector('.device-btn.active');
            if (activeBtn && responsiveDemo.style.display !== 'none') {
                updateDemoFrame(activeBtn);
            }
        });

        // 获取主题
        const currentTheme = localStorage.getItem('theme') || 'light';
        document.documentElement.setAttribute('data-theme', currentTheme);

        // 跳转(优化如果可以)
        let timeLeft = 3;
        const timerElement = document.getElementById('timer');
        
        const countdown = setInterval(() => {
            timeLeft--;
            timerElement.textContent = timeLeft;
            
            if (timeLeft <= 0) {
                clearInterval(countdown);
                window.location.href = '/';
            }
        }, 1000);
    </script>
</body>
</html>